package com.ubiquando.api.server.db;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Basic;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;

//@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@Entity
public class EventMeeting extends Event {

//	@OneToMany
//	private Set<EventPickUp> pickups;
//	@ElementCollection
	@Basic
	private Set<String> pickups;
	
//	protected Set<String> participants;
	
	public EventMeeting(){
		super();
//		this.participants = new HashSet<String>();
	}
	
//	public EventMeeting(int type, String name, Client creator, long time, String destination/*, List<EventPickUp> pickups*/) {
//		super(type, name, creator, time, destination);
//		this.pickups = new HashSet<EventPickUp>();
//	}

	public Set<String> getPickups(){
		return this.pickups;
	}
	
	public void setPickups(Set<String> pickups){
		this.pickups = new HashSet<String>();
		this.pickups.addAll(pickups);
	}
	
	public void addPickupEvent(String pickupId){
		if(this.pickups == null)
			this.pickups = new HashSet<String>();
		this.pickups.add(pickupId);
	}
	
	public void removePickupEvent(String pickupId){
		if(this.pickups != null){
			this.pickups.remove(pickupId);
		}
	}
	
//	public Set<String> getParticipants(){
//		return this.participants;
//	}
//	
//	public void setParticipants(Set<String> participants){
//		this.participants = participants;
//	}
//	
//	public void addParticipant(String clientID){
//		if(this.participants == null)
//			this.participants = new HashSet<String>();
//		this.participants.add(clientID);
//	}
//	
//	public void removeParticipant(String clientId){
//		if(this.participants != null){
//			this.participants.remove(clientId);
//		}
//	}
	
}
